package com.scope.service;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import com.scope.dao.SpringScopeDao;

public class SpringScopeServiceImpl implements SpringScopeService,InitializingBean,DisposableBean {
	private SpringScopeDao ssd;
	@Override
	public void save(String s) {
		System.out.println("执行SpringScopeServiceImpl的save方法");
		ssd.save(s+this.hashCode());
	}
	public void setSsd(SpringScopeDao ssd) {
		this.ssd = ssd;
		System.out.println("setter注入");
	}
	
	public void start(){
		System.out.println("initMethod_start");
	}
	
	public void destroyss(){
		System.out.println("initMethod_destory");
	}
	
	//接口：初始化的销毁方法
	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("接口init");
	}
	@Override
	public void destroy() throws Exception {
		System.out.println("接口destroy");
	}
}
